const localUrl = 'http://118.25.208.36/mpVue/'
// const localUrl = 'http://localhost:8088/mpVue/'
const requestUrl = {
  getArticle: localUrl + 'article/get',
  addArticle: localUrl + 'article/add',
  getArticleDetail: localUrl + 'article/detail',
  getComment: localUrl + 'comment/get',
  sendComment: localUrl + 'comment/send'
}
// 请求方式
function wxRequest ({ url, data, method = 'GET', header = {'content-type': 'application/json'} }) {
  return new Promise((resolve, reject) => {
    wx.request({
      url,
      data,
      header,
      method,
      success (res) {
        resolve(res)
      },
      fail (err) {
        reject(err)
      }
    })
  })
}
export {
  requestUrl,
  wxRequest
}
